/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package modelo.tableModels.renderers.tablecells;

import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;

/**
 *
 * @author Felipe
 */
public class Integer_TableCellRenderer extends JLabel implements TableCellRenderer{

    public Integer_TableCellRenderer(){
        setOpaque(true);
    }

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        Integer integer = (Integer)value;
        setText(integer.toString());
        setHorizontalTextPosition(JLabel.CENTER);
        setHorizontalAlignment(JLabel.CENTER);
            if (isSelected) {
                setBackground(table.getSelectionBackground());
                setForeground(table.getSelectionForeground());
            } else {
                setBackground(table.getBackground());
                setForeground(table.getForeground());
            }
        return this;
    }


}
